use actix_web::{get, HttpResponse, Responder};
use std::collections::HashMap;
use crate::dboper::db2::db2query::query_list;
use serde_json;
#[get("/group/list")]
pub async fn grouplist() -> impl Responder {

    let result : Vec<HashMap<String,String>> =query_list(String::from("select groupid ,groupname,nvl(remark,'--') remark from wf_group"));
    HttpResponse::Ok()
    .content_type("application/json;charset=utf-8")
    .body(
        serde_json::to_string(
            &result
        ).unwrap()

   )
}